<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>开店</title>
    <link href="${ctxPath}/static/web/css/public.css" rel="stylesheet" type="text/css"/>
    <link href="${ctxPath}/static/web/css/css.css" rel="stylesheet" type="text/css"/>
    <link href="${ctxPath}/static/web/css/hbcss.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="${ctxPath}/static/web/js/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="${ctxPath}/static/web/js/public.js"></script>
    <script type="text/javascript" src="${ctxPath}/static/js/jquery.validation.min.js"></script>
    <script type="text/javascript" src="${ctxPath}/static/ajaxfileupload/ajaxfileupload.js"></script>
</head>

<body>
<!--top 开始-->
@layout("/web/include/top.html"){}
<!--top 结束-->
<div class="content">
    <!--和包导航 开始-->
    <!--#include virtual="/include/hb_top.html"-->
    @layout("/web/include/hb_top.html"){}
    <!--和包导航 结束-->

    <div class="hb_mbx">
        <a href="#">我的和包</a> > 店铺基本信息配置
    </div>
    <div class="clear"></div>

    <div class="hb_cont">
        <!--左侧 开始-->
        <!--#include virtual="/include/hb_left.html"-->
        @layout("/web/include/hb_left.html"){}
        <!--左侧 结束-->
        <!--右侧 开始-->
        <div class="hb_cont_r">
            <form action="${ctxPath}/person/addStore" id="submitApply" method="post" enctype="multipart/form-data">
            <div class="hb_r_top">
                <p class="hb_r_top_tit">店铺基本信息配置</p>
                <div class="nb_r_cont">
                    <table width="98%" border="0" cellspacing="0" cellpadding="0" class="nb_table3">
                        <tr>
                            <td width="14%" height="49" align="right"><em class="cf40">*</em><span
                                    class="c999">店铺名称：</span></td>
                            <td class="pl15"><input name="storeName" id="storeName" type="text" class="whs_inp "/></td>
                        </tr>
                        <tr>
                            <td height="59" align="right"><em class="cf40">*</em><span class="c999">店铺Logo上传：</span>
                            </td>
                            <td class="pl15 pt10">
                                <input type="hidden"  name="img" id="img"/>
                                <a href="javascript:void(0);" >
                                    <input type="file" id="file" name="file"
                                           onChange="ajaxFileUploads('file','img');"/></a>
                                <span class="img"></span>
                            </td>
                        </tr>
                        <tr>
                            <td height="46" align="right"><em class="cf40">*</em><span class="c999">掌柜：</span></td>
                            <td class="pl15"><input name="storeOwer" id="storeOwer" type="text" class="whs_inp"/></td>
                        </tr>
                        <tr>
                            <td height="46" align="right"><em class="cf40">*</em><span class="c999">手机号码：</span></td>
                            <td class="pl15"><input name="storeTelephone" id="storeTelephone" type="text" class="whs_inp"/></td>
                        </tr>
                        <tr>
                            <td height="49" align="right"><span class="c999">qq：</span></td>
                            <td class="pl15"><input name="storeQq" id="storeQq" type="text" class="whs_inp"/></td>
                        </tr>
                        <tr>
                            <td height="48" align="right"><em class="cf40">*</em><span class="c999">支付帐号：</span></td>
                            <td class="pl15"><input name="storeMsn" id="storeMsn" type="text" class="whs_inp"/></td>
                        </tr>
                        <tr>
                            <td height="54" align="right"><span class="c999">店铺地址：</span></td>
                            <td class="pl15"><input name="storeAddress" id="storeAddress" type="text" class="whs_inp"/></td>
                        </tr>
                        <tr>
                            <td height="127" align="right"><span class="c999">店铺简介：</span></td>
                            <td class="pl15 pt10 pb10"><textarea name="storeInfo" cols="55" rows="4" class="wdhb_ycc_2" id="storeInfo"></textarea></td>
                        </tr>

                    </table>

                    <div class="nb_r_cont_nr">
                        <a href="#" id="submitBtn" class="link ml150 mb20">
                            <span class="word_left"></span>
                            <span class="word_cen">保存</span>
                            <span class="word_right"></span>
                        </a>
                        <a href="#" class="link ml10">
                            <span class="word_left"></span>
                            <span class="word_cen">重置</span>
                            <span class="word_right"></span>
                        </a>
                    </div>

                    <div class="clear"></div>
                    <div class="ml10 red ">
                        <p>备注：保存后经后台审核通过即可更新. </p>
                    </div>

                </div>
            </div>
            </form>
        </div>
        <!--右侧 结束-->
    </div>

    <!--pay_helpcent 开始-->
    <!--#include virtual="/include/helpcent2.html"-->
    @layout("/web/include/helpcent2.html"){}
    <!--pay_helpcent 开始-->

    <!--foot 开始-->
    <!--#include virtual="/include/foot.html"-->
    @layout("/web/include/foot.html"){}
    <!--foot 结束-->

    <script type="application/javascript">
        //表单提交
        $("#submitBtn").click(function(){
                    //店铺分类的校验
                    $("#submitBtn").attr("disabled",true);
                    $.ajax({
                        type: "post",
                        url: '${ctxPath}/person/addStore',
                        data: $("#submitApply").serialize(),
                        dataType: "json",
                        contentType : "application/x-www-form-urlencoded; charset=utf-8",
                        async:false,
                        success:function(data) {
                            if (data.code=='1'){
                                window.location.href="${ctxPath}/front/store/"+data.id;
                                return true;
                            }else{
                                window.location.href="${ctxPath}/front/tlogin";
                                return true;
                            }


                        }
                    });
        });

        //上传图片
        function ajaxFileUploads(myBlogImage,img){
            $.ajaxFileUpload({
                //处理文件上传操作的服务器端地址(可以传参数,已亲测可用)
                url: '${ctxPath!}/front/fileUpload',
                secureuri:false,                      //是否启用安全提交,默认为false
                fileElementId:myBlogImage,           //文件选择框的id属性
                dataType:'json',                       //服务器返回的格式,可以是json或xml等
                fileSize:5120000,
                success:function(data, status){        //服务器响应成功时的处理函数
                    $("."+img).html(data);
                    $("#"+img).val(data);

                },
                error:function(data, status, e){ //服务器响应失败时的处理函数
                    alert('图片上传失败，请重试！！');

                }
            });
        }
        //]]>

    </script>
</div>
</body>
</html>
